package com.jingshui.Controller;

import com.alibaba.fastjson.JSONObject;
import com.jingshui.Entity.User;
import com.jingshui.Service.DiscussService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import orm.base.Ex.BaseControllerEx;

import java.util.Map;
/**
 * Created by ashin on 2017/9/29.
 */
@Controller
@Scope("prototype")
@RequestMapping("/discuss")
public class DiscussController extends BaseControllerEx{

    @Autowired
    DiscussService discussService;

    @Override
    protected void init() {
        super.init(discussService);
    }

    @Override
    protected JSONObject doInsert(@RequestParam Map map) throws Exception {
        map.put("uId",((User)session.getAttribute("user")).getId());
//        map.put("uId","2");
        return super.doInsert(map);
    }
}
